
/****
 * 
 * When a message succed to get through a filter and its validator, it will be given to a storage manager.
 * The storage manager could store the message and ahve to wanr the final application that a message is ready.
 * The Message will be given to a MessageListener for warn the application.
 * 
 * @author Mathieu Maret
 *
 */
public class StorageManager {
	
	MessageListener listener;

	/**
	 * Create a new StorageManager without a MessageListener 
	 */
	public StorageManager(){
		
	}
	
	
	/**
	 * Store a new message. If a messageListener has been given to the storageManager, the messageReceive() methode will be called.
	 * 
	 * @param m 
	 */
	public void Store(Message m){
		
		if(listener != null){
			listener.messageReceive(m);
		}

		
		
	}
	
	/**
	 * @param messageListener
	 */
	public void addListener(MessageListener messageListener){
		listener = messageListener;
		
	}

}
